-- GENERATED SPELL FOR [Teremus the Devourer] --


function spell0_7846(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7846', 650, 1)
end

function spell1_7846(pUnit, Event) --@Flame Breath,n/a--
pUnit:FullCastSpellOnTarget(9573,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7846', 2000, 1)
end

function spell2_7846(pUnit, Event) --@Knock Away,n/a--
pUnit:FullCastSpellOnTarget(11130,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7846', 538, 1)
end

function spell3_7846(pUnit, Event) --@Soul Consumption,Heal--
pUnit:FullCastSpellOnTarget(12667,pUnit)
pUnit:RegisterEvent('Sorts_7846', 4000, 1)
end

function Sorts_7846(pUnit, Event)
local choix_sorts_7846 = math.random(0, 3)
if choix_sorts_7846 == 0 then
pUnit:RegisterEvent('spell0_7846', 1, 1)
end
if choix_sorts_7846 == 1 then
pUnit:RegisterEvent('spell1_7846', 1, 1)
end
if choix_sorts_7846 == 2 then
pUnit:RegisterEvent('spell2_7846', 1, 1)
end
if choix_sorts_7846 == 3 then
pUnit:RegisterEvent('spell3_7846', 1, 1)
end
end

function mob7846_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7846', math.random(1500, 3000), 1)
end

function mob7846_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7846_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7846_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7846, 1, 'mob7846_Action')
RegisterUnitEvent(7846, 2, 'mob7846_Leave')
RegisterUnitEvent(7846, 3, 'mob7846_Kill')
RegisterUnitEvent(7846, 4, 'mob7846_Die')
